package cn.ht.jywrwater.module.ht.dal.mysql.waterqualitydevicefactor;

import java.util.*;

import cn.ht.jywrwater.framework.common.pojo.PageResult;
import cn.ht.jywrwater.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.ht.jywrwater.framework.mybatis.core.mapper.BaseMapperX;
import cn.ht.jywrwater.module.ht.dal.dataobject.waterqualitydevicefactor.WaterQualityDeviceFactorDO;
import org.apache.ibatis.annotations.Mapper;
import cn.ht.jywrwater.module.ht.controller.admin.waterqualitydevicefactor.vo.*;

/**
 * 水质设备因子 Mapper
 *
 * @author hzx
 */
@Mapper
public interface WaterQualityDeviceFactorMapper extends BaseMapperX<WaterQualityDeviceFactorDO> {

    default PageResult<WaterQualityDeviceFactorDO> selectPage(WaterQualityDeviceFactorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<WaterQualityDeviceFactorDO>()
                .eqIfPresent(WaterQualityDeviceFactorDO::getWaterQualityDeviceCode, reqVO.getWaterQualityDeviceCode())
                .eqIfPresent(WaterQualityDeviceFactorDO::getWaterQualityFactorCode, reqVO.getWaterQualityFactorCode())
                .orderByDesc(WaterQualityDeviceFactorDO::getId));
    }

    default List<WaterQualityDeviceFactorDO> selectList(WaterQualityDeviceFactorExportReqVO reqVO) {
        return selectList(new LambdaQueryWrapperX<WaterQualityDeviceFactorDO>()
                .eqIfPresent(WaterQualityDeviceFactorDO::getWaterQualityDeviceCode, reqVO.getWaterQualityDeviceCode())
                .eqIfPresent(WaterQualityDeviceFactorDO::getWaterQualityFactorCode, reqVO.getWaterQualityFactorCode())
                .orderByDesc(WaterQualityDeviceFactorDO::getId));
    }

}
